#pragma once
#include <wx/ctb/serport.h>
#include "..\Instrument.h"

const int AP_MAX_PARAMS = 256;

#pragma pack(1)
typedef struct Attribute
{
	char ID;
	char OpCode;
	unsigned char Length;
	char Parameters[AP_MAX_PARAMS];
}Attribute;


class AP :	public Instrument, APDialog
{
public:
	int Recursion;
	AP(wxWindow *pParent);
	void *Entry(void);
	void StartDevice(wxString FileName,wxString FilePath,bool File);
	void StopDevice(void);
	int OpenPort(const char *PortCom, const char *OpenVal2, const char *OpenVal3);;
public:
	int		GetFrame(Attribute *pAttr);
	void	GetAttribute(Attribute *pAttr);
	~AP(void);

private:
	wxSerialPort	*pDev;

};
